#include "stdafx.h"
#include "ProgressCallback.h"

HRESULT __stdcall ProgressCallback::QueryInterface(REFIID riid, void** ppvObject)
{
	return E_NOTIMPL;
}

ULONG __stdcall ProgressCallback::AddRef(void)
{
	return 0;
}

ULONG __stdcall ProgressCallback::Release(void)
{
	return 0;
}

HRESULT __stdcall ProgressCallback::OnStartBinding(DWORD dwReserved, IBinding* pib)
{
	return E_NOTIMPL;
}

HRESULT __stdcall ProgressCallback::GetPriority(LONG* pnPriority)
{
	return E_NOTIMPL;
}

HRESULT __stdcall ProgressCallback::OnLowResource(DWORD reserved)
{
	return E_NOTIMPL;
}

HRESULT __stdcall ProgressCallback::OnProgress(ULONG ulProgress, ULONG ulProgressMax, ULONG ulStatusCode, LPCWSTR szStatusText)
{
	if (NULL == this->progress) {
		return S_OK;
	}
	this->progress->SetRange32(0, ulProgressMax);
	this->progress->SetPos(ulProgress);
	return S_OK;
}

HRESULT __stdcall ProgressCallback::OnStopBinding(HRESULT hresult, LPCWSTR szError)
{
	return E_NOTIMPL;
}

HRESULT __stdcall ProgressCallback::GetBindInfo(DWORD* grfBINDF, BINDINFO* pbindinfo)
{
	return E_NOTIMPL;
}

HRESULT __stdcall ProgressCallback::OnDataAvailable(DWORD grfBSCF, DWORD dwSize, FORMATETC* pformatetc, STGMEDIUM* pstgmed)
{
	return E_NOTIMPL;
}

HRESULT __stdcall ProgressCallback::OnObjectAvailable(REFIID riid, IUnknown* punk)
{
	return E_NOTIMPL;
}


void ProgressCallback::BindProgress(CProgressCtrl *progress) {
	this->progress = progress;
}